package View;

import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.*;

import java.io.Serializable;
/** This class create new GUI to Main Menu window and display all the features system */
public class WorkerMainMenuView extends JFrame implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 42L;
	/** Required attributes */
	JButton EnterNewCustomerButton;
	JButton NewMarketingPatternButton;
	JButton ProductToCatalogButton;
	JButton RunSaleButton;
	JButton HandleSaleButton;
	JButton ReportsButton;
	JButton HandleCatalogButton; 
	JButton UpdateCustomerButton; 	
	JButton HandleCityButton; 
	JButton LogOutButton;

	
	
	 /** default and only constructor */
	public WorkerMainMenuView() {
		this.setSize(506,550);
		getContentPane().setLayout(null);
		
		EnterNewCustomerButton = new JButton("Enter New Cutomer");
		EnterNewCustomerButton.setBounds(71, 13, 337, 36);
		EnterNewCustomerButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(EnterNewCustomerButton);
		
		
		UpdateCustomerButton= new JButton("Update Customer");
		UpdateCustomerButton.setBounds(71, 60, 337, 39);
		UpdateCustomerButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(UpdateCustomerButton);
		
		
		
		 NewMarketingPatternButton = new JButton("Configure New Marketing Pattern");
		 NewMarketingPatternButton.setBounds(67, 110, 341, 39);
		NewMarketingPatternButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(NewMarketingPatternButton);
		
		 ProductToCatalogButton = new JButton("Add Product To Catalog");
		 ProductToCatalogButton.setBounds(67, 160, 341, 34);
		ProductToCatalogButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(ProductToCatalogButton);
		
		 RunSaleButton = new JButton("Run New Sale");
		 RunSaleButton.setBounds(67, 205, 341, 35);
		RunSaleButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(RunSaleButton);
		
		 
		
		 HandleCatalogButton = new JButton("Handle Catalog");
		 HandleCatalogButton.setBounds(67, 251, 341, 35);
		HandleCatalogButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(HandleCatalogButton);
		
		
		 HandleSaleButton = new JButton("Handle New Sale");
		 HandleSaleButton.setBounds(67, 297, 341, 35);
		HandleSaleButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(HandleSaleButton);
		
		 ReportsButton = new JButton("Reports");
		 ReportsButton.setBounds(67, 343, 341, 35);
		ReportsButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(ReportsButton);
		
		
		HandleCityButton = new JButton("Handle City List");
		HandleCityButton.setBounds(67, 389, 341, 35);
		HandleCityButton.setFont(new Font("Tahoma", Font.BOLD, 16));
		getContentPane().add(HandleCityButton);
		
		
		LogOutButton = new JButton("LogOut");
		LogOutButton.setBounds(151, 445, 161, 45);
		LogOutButton.setFont(new Font("Rockwell", Font.BOLD, 18));
		getContentPane().add(LogOutButton);
		
		
		
		setTitle("Main Menu");
		
		this.setResizable(false);
		this.setLocationRelativeTo(null); 
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	
	/** show and hide window functions */
	public void showWindow(){
		setVisible(true);
	}
	public void hideWindow(){
		setVisible(false);
	}
	
	/**
	 * add action listener to any button in the window
	 * @param actionListener
	 */
	public void addWorkerMainMenuListener(ActionListener actionListener){
		EnterNewCustomerButton.addActionListener(actionListener);
		NewMarketingPatternButton.addActionListener(actionListener);
		ProductToCatalogButton.addActionListener(actionListener);
		RunSaleButton.addActionListener(actionListener);
		HandleSaleButton.addActionListener(actionListener);
		ReportsButton.addActionListener(actionListener);
		HandleCatalogButton.addActionListener(actionListener);
		LogOutButton.addActionListener(actionListener);
		UpdateCustomerButton.addActionListener(actionListener);
		HandleCityButton.addActionListener(actionListener);
	}

	
	/**
	 * @return button EnterNewCustomerButton
	 */
	public JButton getEnterNewCustomerBtn() {
		return  EnterNewCustomerButton;
	}
	/**
	 * @return button NewMarketingPatternButton
	 */
	public JButton getNewPatternBtn() {
		return  NewMarketingPatternButton;
	}
	/**
	 * @return button ProductToCatalogButton
	 */
	public JButton getProductToCatalogBtn() {
		return  ProductToCatalogButton;
	}
	/**
	 * @return button RunSaleButton
	 */
	public JButton getRunSaleBtn() {
		return  RunSaleButton;
	}
	/**
	 * @return button HandleSaleButton
	 */
	public JButton getHandleSaleBtn() {
		return  HandleSaleButton;
	}
	/**
	 * @return button ReportsButton
	 */
	public JButton getReportsnBtn() {
		return  ReportsButton;
	}
	/**
	 * @return button HandleCatalogButton
	 */
	public JButton getHandleCatalogBtn() {
		return  HandleCatalogButton;
	}
	/**
	 * @return button LogOutButton
	 */
	public JButton getLogoutBtn(){
		return LogOutButton;
	}
	/**
	 * @return button UpdateCustomerButton
	 */
	public JButton getUpdateCustomerBtn(){
		return UpdateCustomerButton;
	}
	/**
	 * @return button HandleCityButton
	 */
	public JButton getHandleCityBtn(){
		return HandleCityButton;
	}
}